package com.atguigu.day01;

import java.lang.reflect.Method;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;

/**
 * 面试题
 *
 * @author sx
 * @date 2022-02-24 16:52
 */
public class Demo11 {
    public static void main(String[] args) {
        ArrayList<String> a = new ArrayList<>();
        a.add("CSDN");
        Class c = a.getClass();
        try {
            Method method = c.getMethod("add", Object.class);
            method.invoke(a, 100);
            System.out.println(a);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
